const http = uni.$u.http
import { baseUrl } from "../common/http.interceptor";

export default {
    /**
     * 文件上传
     */
    uploadImage: baseUrl + '/upload/file',

    /**
     * Banner相关
     */
    // 获取Banner列表
    getBannerList: (params) => http.get('/banner/list', params),
    // Banner增删改查
    getBanner: (id) => http.get(`/banner/${id}`),
    createBanner: (data) => http.post('/banner', data),
    updateBanner: (id, data) => http.put(`/banner/${id}`, data),
    deleteBanner: (id) => http.delete(`/banner/${id}`),

    /**
     * 用户相关
     */
    // 获取用户列表
    getUserList: (params) => http.get('/user/list', params),
    // 用户增删改查
    getUserInfo: (id) => http.get(`/user/${id}`),
    createUser: (data) => http.post('/user', data),
    updateUser: (id, data) => http.put(`/user/${id}`, data),
    deleteUser: (id) => http.delete(`/user/${id}`),
    // 用户统计
    getUserStatic: (params) => http.get('/user/static', params),
    getUserQrCode: (params) => http.get('/user/wx/getUserQrCode', params),
    wxLogin: (data) => http.post('/user/wx/login', data),
    supplierLogin: (data) => http.post('/supplier/login', data),
    purchaseLogin: (data) => http.post('/purchase/login', data),
    getSupplierDetail: (id) => http.get(`/supplier/${id}`),
    getPurchaseDetail: (id) => http.get(`/purchaser/${id}`),

    /**
     * 地址相关
     */
    // 获取地址列表
    getAddressList: (params) => http.get('/address/list', params),
    // 地址增删改查
    getAddressDetail: (id) => http.get(`/address/${id}`),
    addAddress: (data) => http.post('/address', data),
    updateAddress: (id, data) => http.put(`/address/${id}`, data),
    deleteAddress: (id) => http.delete(`/address/${id}`),

    /**
     * 配置相关
     */
    // 获取配置列表
    getConfigList: (params) => http.get('/config/list', params),
    // 配置增删改查
    getConfig: (id) => http.get(`/config/${id}`),
    createConfig: (data) => http.post('/config', data),
    updateConfig: (id, data) => http.put(`/config/${id}`, data),
    deleteConfig: (id) => http.delete(`/config/${id}`),
    // 根据key获取配置
    getConfigByKey: (key) => http.get(`/config/key/${key}`),

    /**
     * 文章相关
     */
    // 获取文章列表
    getArticleList: (params) => http.get('/article/list', params),
    getArticlePage: (params) => http.get('/article', params),
    // 文章增删改查
    getArticle: (id) => http.get(`/article/${id}`),
    createArticle: (data) => http.post('/article', data),
    updateArticle: (id, data) => http.put(`/article/${id}`, data),
    deleteArticle: (id) => http.delete(`/article/${id}`),

    /**
     * 面试相关
     */
    // 获取面试列表
    getInterviewList: (params) => http.get('/interview/list', params),
    // 面试增删改查
    getInterview: (id) => http.get(`/interview/${id}`),
    createInterview: (data) => http.post('/interview', data),
    updateInterview: (id, data) => http.put(`/interview/${id}`, data),
    deleteInterview: (id) => http.delete(`/interview/${id}`),

    /**
     * 通知相关
     */
    // 获取通知列表
    getNoticeList: (params) => http.get('/notice/list', params),
    // 通知增删改查
    getNotice: (id) => http.get(`/notice/${id}`),
    createNotice: (data) => http.post('/notice', data),
    updateNotice: (id, data) => http.put(`/notice/${id}`, data),
    deleteNotice: (id) => http.delete(`/notice/${id}`),

    /**
     * 产品相关
     */
    // 获取产品列表
    getProductList: (params) => http.get('/product/list', params),
    // 产品增删改查
    getProduct: (id) => http.get(`/product/${id}`),

    /**
     * 工单相关
     */
    // 获取工单列表
    getWorkorderList: (params) => http.get('/workorder/list', params),
    // 工单增删改查
    getWorkorder: (id) => http.get(`/workorder/${id}`),
    createWorkorder: (data) => http.post('/workorder', data),
    updateWorkorder: (id, data) => http.put(`/workorder/${id}`, data),
    deleteWorkorder: (id) => http.delete(`/workorder/${id}`),
    // 工单进度
    getWorkorderProgress: (id) => http.get(`/workorder/${id}/progress`),
    // 接单
    acceptWorkorder: (id) => http.post(`/workorder/${id}/accept`),
    // 验收
    acceptWorkorderDelivery: (id) => http.post(`/workorder/${id}/delivery`),
    createProduct: (data) => http.post('/product', data),
    updateProduct: (id, data) => http.put(`/product/${id}`, data),
    deleteProduct: (id) => http.delete(`/product/${id}`),

    /**
     * 产品分类相关
     */
    // 获取产品分类列表
    getProductCategoryList: (params) => http.get('/productCategory/list', params),

    /**
     * 产品规格相关
     */
    // 获取产品规格列表
    getProductSpecList: (params) => http.get('/productSpec/list', params),
    // 产品规格增删改查
    getProductSpec: (id) => http.get(`/productSpec/${id}`),
    createProductSpec: (data) => http.post('/productSpec', data),
    updateProductSpec: (id, data) => http.put(`/productSpec/${id}`, data),
    deleteProductSpec: (id) => http.delete(`/productSpec/${id}`),

    /**
     * 产品SKU相关
     */
    // 获取产品SKU列表
    getProductSkuList: (params) => http.get('/productSku/list', params),
    // 产品SKU增删改查
    getProductSku: (id) => http.get(`/productSku/${id}`),
    createProductSku: (data) => http.post('/productSku', data),
    updateProductSku: (id, data) => http.put(`/productSku/${id}`, data),
    deleteProductSku: (id) => http.delete(`/productSku/${id}`),

    /**
     * 问答相关
     */
    // 获取问答列表
    getQaList: (params) => http.get('/qa/list', params),
    getQaPage: (params) => http.get('/qa', params),
    // 问答增删改查
    getQa: (id) => http.get(`/qa/${id}`),
    createQa: (data) => http.post('/qa', data),
    updateQa: (id, data) => http.put(`/qa/${id}`, data),
    deleteQa: (id) => http.delete(`/qa/${id}`),

    /**
     * 问题相关
     */
    // 获取问题列表
    getQuestionList: (params) => http.get('/question/list', params),
    // 问题增删改查
    getQuestion: (id) => http.get(`/question/${id}`),
    createQuestion: (data) => http.post('/question', data),
    updateQuestion: (id, data) => http.put(`/question/${id}`, data),
    deleteQuestion: (id) => http.delete(`/question/${id}`),

    /**
     * 题库相关
     */
    // 获取题库列表
    getQuestionBankList: (params) => http.get('/questionBank/list', params),
    getQuestionBankPage: (params) => http.get('/questionBank', params),
    getQuestionBankGroupBy: (params) => http.get('/questionBank/groupBy', params),
    // 题库增删改查
    getQuestionBank: (id) => http.get(`/questionBank/${id}`),
    createQuestionBank: (data) => http.post('/questionBank', data),
    updateQuestionBank: (id, data) => http.put(`/questionBank/${id}`, data),
    deleteQuestionBank: (id) => http.delete(`/questionBank/${id}`),

    /**
     * 问题选项相关
     */
    // 获取问题选项列表
    getQuestionOptionList: (params) => http.get('/questionOption/list', params),
    // 问题选项增删改查
    getQuestionOption: (id) => http.get(`/questionOption/${id}`),
    createQuestionOption: (data) => http.post('/questionOption', data),
    updateQuestionOption: (id, data) => http.put(`/questionOption/${id}`, data),
    deleteQuestionOption: (id) => http.delete(`/questionOption/${id}`),

    /**
     * 地区相关
     */
    // 获取地区列表
    getRegionList: (params) => http.get('/region/list', params),
    // 地区增删改查
    getRegion: (id) => http.get(`/region/${id}`),
    createRegion: (data) => http.post('/region', data),
    updateRegion: (id, data) => http.put(`/region/${id}`, data),
    deleteRegion: (id) => http.delete(`/region/${id}`),

    /**
     * 答题记录相关
     */
    // 获取答题记录列表
    getAnswerRecordList: (params) => http.get('/answerRecord/list', params),
    // 答题记录增删改查
    getAnswerRecord: (id) => http.get(`/answerRecord/${id}`),
    createAnswerRecord: (data) => http.post('/answerRecord', data),
    updateAnswerRecord: (id, data) => http.put(`/answerRecord/${id}`, data),
    deleteAnswerRecord: (id) => http.delete(`/answerRecord/${id}`),

    /**
     * 订单相关
     */
    // 订单增删改查
    getOrderList: (params) => http.get('/order', params),
    getOrderDetail: (id) => http.get(`/order/${id}`),
    createOrder: (data) => http.post('/order', data),
    updateOrder: (id, data) => http.put(`/order/${id}`, data),
    deleteOrder: (id) => http.delete(`/order/${id}`),
    // 订单操作
    createPay: (data) => http.post('/payment/wx', data),
    cancelOrder: (data) => http.post('/order/cancel', data),
    confirmReceipt: (data) => http.post('/order/confirm', data),

    /**
     * 练习相关
     */
    // 创建练习记录
    createPracticeRecord: (data) => http.post('/answerRecord', data),
    // 提交练习记录
    submitPracticeRecord: (data) => http.post('/answerRecord/submit', data),
    // 获取练习结果
    getPracticeResult: (practiceId) => http.get(`/answerRecord/${practiceId}`),
    getPracticePage: data => http.get('/answerRecord', data),


    /**
     * 旅行分类、旅行产品
     */
    // 获取旅行分类列表
    getTravelCategoryList: (params) => http.get('/travelCategory/list', params),
    // 获取旅行产品列表
    getTravelList: (params) => http.get('/travel/list', params),
    // 获取旅行产品详情
    getTravelDetail: (id) => http.get(`/travel/${id}`),
    // 获取旅行SKU列表
    getTravelSkuList: (params) => http.get('/travelSku/list', params),
    // 获取旅行每日库存列表
    getTravelSkuStockList: (params) => http.get('/travelSkuStock/list', params),
    // sku详情
    getTravelSkuDetail: (id) => http.get(`/travelSku/${id}`),
    // sku库存
    getTravelSkuStock: (id) => http.get(`/travelSkuStock/${id}`),

    /**
     * 用户帖子
     */
    getUserPostPage: (params) => http.get('/userPost', params),
    createUserPost: (data) => http.post('/userPost', data),
    getUserPostList: (params) => http.get('/userPost/list', params),
    likeUserPost: (id, data) => http.post(`/userPost/like/${id}`, data),
    unlikeUserPost: (id,data) => http.post(`/userPost/unlike/${id}`,data),

    /**
     * 旅游方案定制
     */
    getTravelCustomPage: (params) => http.get('/travelCustom', params),
    getTravelCustomList: (params) => http.get('/travelCustom/list', params),
    getTravelCustomDetail: (id) => http.get(`/travelCustom/${id}`),
    createTravelCustom: (data) => http.post('/travelCustom', data),
    updateTravelCustom: (id, data) => http.put(`/travelCustom/${id}`, data),
    deleteTravelCustom: (id) => http.delete(`/travelCustom/${id}`),
    updateTravelCustomStatus: (id, data) => http.post(`/travelCustom/${id}/status`, data),
    uploadTravelCustomPlan: (id, data) => http.post(`/travelCustom/${id}/plan`, data),
    /**
     * 出行人接口
     */
    getTravelerList: (params) => http.get('/traveler/list', params),
    getTraveler: (id) => http.get(`/traveler/${id}`),
    createTraveler: (data) => http.post('/traveler', data),
    updateTraveler: (id, data) => http.put(`/traveler/${id}`, data),
    deleteTraveler: (id) => http.delete(`/traveler/${id}`),


    /**
     * 修改为出行订单TravelOrder
     */
    // 订单增删改查
    getTravelOrderList: (params) => http.get('/travelOrder', params),
    getTravelOrderDetail: (id) => http.get(`/travelOrder/${id}`),
    createTravelOrder: (data) => http.post('/travelOrder', data),
    updateTravelOrder: (id, data) => http.put(`/travelOrder/${id}`, data),
    deleteTravelOrder: (id) => http.delete(`/travelOrder/${id}`),
    // 订单操作
    createTravelOrderPay: (data) => http.post('/travelOrder/payment/wx', data),
    cancelTravelOrder: (data) => http.post('/travelOrder/cancel', data),
    confirmTravelOrderReceipt: (data) => http.post('/travelOrder/confirm', data),

    /**
     * 采购单相关
     */
    // 获取采购单列表
    getDailyMenuList: (params) => http.get('/daily-menu', params),
    // 采购单增删改查
    getDailyMenu: (id) => http.get(`/daily-menu/${id}`),
    createDailyMenu: (data) => http.post('/daily-menu', data),
    updateDailyMenu: (id, data) => http.put(`/daily-menu/${id}`, data),
    deleteDailyMenu: (id) => http.delete(`/daily-menu/${id}`),

    /**
     * 供应商相关
     */
    // 获取供应商列表
    getSupplierList: (params) => http.get('/supplier', params),

    /**
     * 采购员相关
     */
    // 获取采购员列表
    getPurchaserList: (params) => http.get('/purchaser', params),

    /**
     * 月度比价相关
     */
    // 获取月度比价列表
    getMonthlyBiddingList: (params) => http.get('/monthly-bidding/list', params),

    /**
     * 菜品相关
     */
    // 获取菜品列表
    getDishList: (params) => http.get('/dish/list', params),

    /**
     * 采购单菜品相关
     */
    // 获取采购单菜品列表
    getDailyMenuItemList: (params) => http.get('/daily-menu-item/list', params),
    // 获取采购单菜品详情
    getDailyMenuItem: (id) => http.get(`/daily-menu-item/${id}`),
    // 创建采购单菜品
    createDailyMenuItem: (data) => http.post('/daily-menu-item', data),
    // 更新采购单菜品
    updateDailyMenuItem: (id, data) => http.put(`/daily-menu-item/${id}`, data),
    // 删除采购单菜品
    deleteDailyMenuItem: (id) => http.delete(`/daily-menu-item/${id}`),
    // 批量创建采购单菜品
    batchCreateDailyMenuItem: (data) => http.post('/daily-menu-item/batch-create', data),
    // 批量更新采购单菜品
    batchUpdateDailyMenuItem: (data) => http.post('/daily-menu-item/batch-update', data),
    // 批量确认收货
    batchConfirmReceipt: (data) => http.post('/daily-menu-item/batch-confirm-receipt', data),
    // 批量确认采买
    batchConfirmBuy: (data) => http.post('/daily-menu-item/batch-confirm-buy', data),

    /**
     * 菜品评价相关
     */
    getDishRatingList: (params) => http.get('/dish-rating/list', params),
    getDishRating: (id) => http.get(`/dish-rating/${id}`),
    createDishRating: (data) => http.post('/dish-rating', data),
    updateDishRating: (id, data) => http.put(`/dish-rating/${id}`, data),
    deleteDishRating: (id) => http.delete(`/dish-rating/${id}`),

    /**
     * 供应商报价相关
     */
    // 获取供应商报价列表

    getSupplierQuoteList: (params) => http.get('/supplier-quote/list', params),

}
